package view {
	import controller.signal.DebugSignal;
	import controller.signal.PhotosLoadedSignal;
	import controller.signal.StateChangeSignal;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.MouseEvent;
	
	import model.PhotoModel;
	import model.vo.PhotoVO;
	
	import mx.containers.Canvas;
	import mx.controls.Alert;
	import mx.controls.Image;
	
	import org.robotlegs.mvcs.Mediator;
	
	import spark.primitives.BitmapImage;
	
	public class PrivateViewMediator extends Mediator {
		
		[Inject] public var _view:PrivateView;
		[Inject] public var photosLoaded:PhotosLoadedSignal;
 	 	[Inject] public var photoModel:PhotoModel;
		[Inject] public var debugSignal:DebugSignal;
		
		public override function onRegister():void {
			super.onRegister();
			photosLoaded.add(onPhotos);
		}
	
		private function onPhotos():void {
			
			
			
			_view.photoShow.addPhotos(photoModel.photos);
			_view.photoShow.debug.add(onDebug);
			//var image:BitmapImage= new BitmapImage();
			//image.source = FaceDectector.instance.detectionMap;
			
			//show.addElement(image);
			
		}
		
		private function onDebug(bmd:BitmapData):void {
			debugSignal.dispatch(bmd);
		}
		
		public override function onRemove():void {
			super.onRemove();
		}
	}
}